	<!--
 	<!-- Display Design Note 
 	<%
 	if(dispalyDesignNote==true)
 	{
 		try
 		{
 	%>
 	  <div class="tabbertab">
	  <h2>Design Note</h2>
	  <p>	  </p> 
	  <form action="designNote.jsp" method="get" >
	  <table border="1" bordercolor="black" width="100%">
	<tr><th colspan="2">Design Note Template</th></tr>
	<tr><th colspan="1">Design Notes</th> <th >Designer Response</th></tr>
	<%
	DesignNote dn=new DesignNote(crno);

	dn.loadDetails();
	Vector<String> note=dn.getDesignNotes();
	Vector<String> description=dn.getDescription();
	Vector<String> resp=dn.getResponse();
	int i=0;
	while(i < note.size())
	{
	%>
	<tr>
	<td><b><%=note.elementAt(i) %></b><br/><%=description.elementAt(i) %></td>
	<td><%=resp.elementAt(i) %></td>
	</tr>
	<%
	i++;
	}
	%>
	</table>
	<br/>
	<input type="submit" value="edit" >
	</form>
	</div>
 	<%
 		}
 		catch(Exception e)
 		{
 			System.out.println("Exception while displaying design note "+crno+" :"+e.getMessage());
 		}
 	}
	%> 
	
	
 <!-- Display checklist -->
 
	<div class="tabbertab">
	  <h2>Check List</h2>
	  <p>  </p>  
	  
	  <%
	  {
		  Vector<String> reject=null;
	try
	  {

	  	cklist.loadDetails();
	  
	  	Vector<String> item=cklist.getItem();
	  	Vector<String> designerComments=cklist.getDesignerComments();
	  	Vector<String> designerResponse=cklist.getDesignerResponse();
	  	Vector<String> reviewerComments=cklist.getReviewerComments();
	  	Vector<String> reviewerResponse=cklist.getReviewerResponse();
	  	reject=cklist.getRejectStatus("checklist");
	  	if(reject==null)
	  	{
	  		throw new Exception("reject is null");
	  	}
     
	 %>
	 
    <form action="saveComments.jsp"  id="saveReview" method="post">
    <table width=100% height=100% border=1 bordercolor="black" >
    <tr>
    <th bgcolor='CCCCFF'>Sr. No</th>
    <th bgcolor='CCCCFF'>ITEM</th>
    <th bgcolor='CCCCFF'>Designer</th>
    <th bgcolor='CCCCFF'>Comments</th>
    <th bgcolor='CCCCFF'>Reviewer Response</th>
    <th bgcolor='CCCCFF'>Reviewer Comments</th>
    </tr>
    
	<%
	int i=0;
	String selected="",comments="", reviewer1="",rResponse="";
	int srno=0;
	int  count=0;
    while(i < designerComments.size())
    {
    	srno++;
    	
    	selected=designerResponse.elementAt(i);
    	comments=designerComments.elementAt(i);
    	reviewer1=reviewerComments.elementAt(i);
    	rResponse=reviewerResponse.elementAt(i);

    	if(selected==null)
    	{
    		selected=" ";
    	}
    	if(comments==null)
    	{
    		comments=" ";
    	}
    	if(reviewer1==null)
    	{
    		reviewer1=" ";
    	}
    	if(rResponse==null)
    	{
    		rResponse=" ";
    	}
	%>
	<tr>
	<%
	   if(srno==1 || srno==10 || srno==17 || srno==20 || srno==22 || srno==31 || srno==34 || srno==40 || srno==45 || srno==53 || srno==65    )
	   {
	   %>
	   <td bgcolor='99FFFF'> <%=i+1%></td>
	   <td bgcolor='99FFFF'><%=item.elementAt(i)%></td>
	   <td bgcolor='99FFFF'> <%=selected%></td>
	   <td bgcolor='99FFFF'><%=comments%></td>
	   <td bgcolor='99FFFF'> <%=rResponse%></td>
	   <td bgcolor='99FFFF'> <%=reviewer1%></td>
	   <%
	   }
	   else if(((String)session.getAttribute("reviewer")).equals("designer"))
		{
		   count++;
		   %>
		   <td bgcolor='AliceBlue'> <%=i+1%></td>
		   <td bgcolor='AliceBlue'><%=item.elementAt(i)%></td>
		   <%
		   if(selected.equals("Yes"))
		   	{
			   %>
			   <td bgcolor='AliceBlue'><select id="dd<%=count%>" name="dd<%=count%>" ><option selected="selected">Yes</option><option>No</option><option>NA</option></select></td>
			   <%
		   	}else if(selected.equals("No"))
		   	{
			   %>
			   <td bgcolor='AliceBlue'><select id="dd<%=count%>" name="dd<%=count%>" ><option selected="selected">No</option><option>Yes</option><option>NA</option></select></td>
			   <%
		   	}
		   	else
		   	{
			   %>
			   <td bgcolor='AliceBlue'><select id="dd<%=count%>" name="dd<%=count%>" ><option selected="selected">NA</option><option>Yes</option><option>No</option></select></td>
			   <%
		   	}
		   %>
		   <td bgcolor='AliceBlue'><textarea name='t<%=count %>' rows='5' cols='15' ><%=comments%></textarea></td>
		   <td bgcolor='AliceBlue'> <%=rResponse%></td>
		   <td bgcolor='AliceBlue'> <textarea readonly="readonly" rows='5' cols='15' ><%=reviewer1%></textarea></td>
		   <%
		}
	   else if(((String)session.getAttribute("reviewer")).equals("reviewer"))
	   {
		   count++;
		   %>
		   <td bgcolor='AliceBlue'> <%=i+1%></td>
		   <td bgcolor='AliceBlue'><%=item.elementAt(i)%></td>
		   <td bgcolor='AliceBlue'> <%=selected%></td>
		   <td bgcolor='AliceBlue'><textarea readonly="readonly" rows='5' cols='15' ><%=comments%></textarea></td>
		   
		   <%
		   if(rResponse.equals("Yes"))
		   	{
			   %>
			   <td bgcolor='AliceBlue'><select id="dd<%=count%>" name="dd<%=count%>" ><option selected="selected">Yes</option><option>No</option><option>NA</option></select></td>
			   <%
		   	}else if(rResponse.equals("No"))
		   	{
			   %>
			   <td bgcolor='AliceBlue'><select id="dd<%=count%>" name="dd<%=count%>" ><option selected="selected">No</option><option>Yes</option><option>NA</option></select></td>
			   <%
		   	}
		   	else
		   	{
			   %>
			   <td bgcolor='AliceBlue'><select id="dd<%=count%>" name="dd<%=count%>" ><option selected="selected">NA</option><option>Yes</option><option>No</option></select></td>
			   <%
		   	}
		   %>
		   <td bgcolor='AliceBlue'><textarea name='t<%=count %>' rows='5' cols='15' ><%=reviewer1%></textarea></td>
		   
		   <%
	   }
	   else
	   {
		   %>
		   <td bgcolor='AliceBlue'> <%=i+1%></td>
		   <td bgcolor='AliceBlue'><%=item.elementAt(i)%></td>
		   <td bgcolor='AliceBlue'> <%=selected%></td>
		   <td bgcolor='AliceBlue'><%=comments%></td>
		   <td bgcolor='AliceBlue'> <%=rResponse%></td>
		   <td bgcolor='AliceBlue'> <%=reviewer1%></td>
		   <%
	   }
		%>
		</tr>
		<%
	   i++;
    }
   }catch(Exception e)
   {
   		System.out.println("Exception while displaying the checklist :"+crno+" :"+e.getMessage());
   }
   %>
   </table>
   <input type="hidden" id="reviewHidden" name="reviewHidden" value="true" >
    <br/>
    <table  border="1" >
    	<%
		Inbox inb=new Inbox(crno);
		inb.loadDetails();
    	{

    		if(inb.rStatus.equals("open"))
    		{
				if(((String)session.getAttribute("reviewer")).equals("designer"))
				{
  		%>
  		<tr>
   		<td><input type="submit" value="Save" ></td>
   		</tr>
   		<%
				}else if(((String)session.getAttribute("reviewer")).equals("reviewer"))
				{
   		%>
   		<tr>
   		 <td><b>Accept the Checklist</b></td><td><input type="submit" value="Accept" ></td>
   		 </tr>
   		 <tr>
   		 <td><b>Reject the Checklist</b></td><td><input type="submit" value="Reject" onclick="return submitForm()" ></td>
   		 </tr>
   		<%
				}
    		}
    	}
   		%>
   		</table>
   </form>
   <table>
   <%
   if(inb.rStatus.equals("open"))
   {
   %>
	    	  		<tr>
	    	   		<td><b>Checklist is pending with reviewer</b></td>
	    	   		</tr>
   <%
	
   }
   else
   {
   %>
       	  		<tr>
    	   		<td><b>Reviewer has accepted the Checklist</b></td>
    	   		</tr>
   <%
   }
   %>
   </table>
   
   <%
	  }
   %>
</div>
 

     
     <!-- Display internal IDCE -->
 
     <div class="tabbertab">
	  <h2>Internal IDCE</h2>
	  <p></p>

	  <form method="post" action="updateIDCEComments.jsp" >
	  <br/>

	  <%
	  {
			 String iRevStatus="";
		  Vector<String> reject=null;
		  try
		  {
		  String status="";
		  CRDB crdb=new CRDB(crno);
		  CRDetails crd=new CRDetails(crno);
		  crd.loadDetails();
		  String intRevName=crd.getInternalReviewer();
		  IDCE idce=new IDCE(crno);
		  Vector<String> idceCount=idce.getCommentsCount("internal");
		  status=crdb.getReviewStatus();
		  String link=idce.getIDCELink("internal");
		  String number=idce.getIDCENumber("internal");
		  reject=cklist.getRejectStatus("internal");
		  if(reject==null)
		  {
			  throw new Exception("reject is null");
		  }
		  
	  if(((String)session.getAttribute("reviewer")).equals("designer") && status.equals("internal"))
	  {
	  %>
	<center><h4><a href="addIDCEComments.jsp" >Change the internal IDCE details</a></h4></center>
	<br/>
	  <%
	  }
	  %>
	  	<table border=1 bordercolor="black" >
	  	<tr>
	  	<th colspan="2"> IDCE details</th>
	  	</tr>
	  	<tr>
		<td>IDCE Number</td>
		<td><%=number %></td>
	  	</tr>
	  	<tr>
		<td>IDCE Link</td>
		<td><a href="<%=link %>"><%=link %></a></td>
	  	</tr>
	  	<tr>
	  	<td>Internal Reviewers Name</td>
	  	<td><%=intRevName %></td>
	  	</tr>
	  	</table>
		<br/>
	  	<table border=1 bordercolor="black" >
	  	<tr>
		<th>Defect Type</th>
		<th> Number of defects</th>
	  	</tr>
		<tr>
		<td>Program Code-High</td>
		<th><%=idceCount.elementAt(0) %></th>
		</tr>
		
		<tr>
		<td>Program Code-Medium</td>
		<th><%=idceCount.elementAt(1) %></th>
		</tr>
		
		<tr>
		<td>Program Code-Low</td>
		<th><%=idceCount.elementAt(2) %></th>
		</tr>
		
		<tr>
		<td>Code Comments</td>
		<th><%=idceCount.elementAt(3) %></th>
		</tr>
		
		<tr>
		<td>Documentation</td>
		<th><%=idceCount.elementAt(4) %></th>
		</tr>
			
		<tr>
		<td>Non Defects</td>
		<th><%=idceCount.elementAt(5) %></th>
		</tr>
			
	 <tr bordercolor="white" ><td>
	 </td></tr>
	 </table>
	 </form>
	 <form method="post" action="updateIDCEComments.jsp" name="internalForm" id="internalForm" >
	 <table border=1 bordercolor="black">
	 <tr>
	 <th>Pre-Approval of Internal IDCE Question</th>
	 <th>Designer Response</th>
	 <th>Designer Comments</th>
	 <th>Reviewer Response</th>
	 <th>Reviewer Comments</th>
	 </tr>
		<%
		 {
	         CRDB crDB=new CRDB(crno);
	     	 crDB.loadDetails();
	     	iRevStatus=crDB.getReviewStatus();
		 }
			Vector<String> rResponse,dResponse;
			Vector<String> rComments,dComments;
			Vector<String> quest;
			idce.loadIDCEResponse("internal");
			rResponse=idce.getReviewerResponse();
			rComments=idce.getReviewerComments();
			dResponse=idce.getDesignerResponse();
			dComments=idce.getDesignerComments();

			quest=idce.getQuest();

			if(((String)session.getAttribute("reviewer")).equals("reviewer") && iRevStatus.equals("internal"))
			{
				int i=0;
				String selected;

				while(i <quest.size())
				{
					selected=rResponse.elementAt(i);
					%>
					<tr>
					<td><%=quest.elementAt(i) %></td>
					<td><center><%=dResponse.elementAt(i) %></center></td>
					<td><center><%=dComments.elementAt(i) %></center></td>
					<%
		  	 		if(selected.equals("Yes"))
		   			{
			   		%>
			   		<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="validateInternalQuest()" ><option selected="selected" value="Yes">Yes</option><option value="No">No</option><option value="NA">NA</option></select></td>
			   		<%
		   			}else if(selected.equals("No"))
		   			{
			   		%>
			   		<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="validateInternalQuest()" ><option selected="selected" value="No">No</option><option value="Yes">Yes</option><option value="NA" >NA</option></select></td>
			   		<%
		   			}
		   			else
		   			{
			   		%>
			  		 <td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="validateInternalQuest()" ><option selected="selected" value="NA">NA</option><option value="Yes">Yes</option><option value="No">No</option></select></td>
			   		<%
		   			}
		   			%>
			
					<td><textarea id="text<%=i %>" name="text<%=i%>" ><%=rComments.elementAt(i) %></textarea></td>
					</tr>
	
					<%
					i++;
				}
			}
			else if(((String)session.getAttribute("reviewer")).equals("designer") && iRevStatus.equals("internal"))
			{
				int i=0;
				String selected;

				while(i <quest.size())
				{
					selected=dResponse.elementAt(i);
					%>
					<tr>
					<td><%=quest.elementAt(i) %></td>
					<%
			 
		  	 		if(selected.equals("Yes"))
		   			{
			   		%>
			   		<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="validateInternalQuest()" ><option selected="selected" value="Yes">Yes</option><option value="No">No</option><option value="NA">NA</option></select></td>
			   		<%
		   			}else if(selected.equals("No"))
		   			{
			   		%>
			   		<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="validateInternalQuest()" ><option selected="selected" value="No">No</option><option value="Yes">Yes</option><option value="NA" >NA</option></select></td>
			   		<%
		   			}
		   			else
		   			{
			   		%>
			  		 <td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="validateInternalQuest()" ><option selected="selected" value="NA">NA</option><option value="Yes">Yes</option><option value="No">No</option></select></td>
			   		<%
		   			}
		   			%>
			
					<td><textarea id="text<%=i %>" name="text<%=i%>" ><%=dComments.elementAt(i) %></textarea></td>
					<td><center><%=rResponse.elementAt(i) %></center></td>
					<td><center><%=rComments.elementAt(i) %></center></td>
					</tr>
	
					<%
					i++;
				}
			}
			else
			{
				int i=0;
				while(i< quest.size())
				{
				%>
					<tr>
				   	<td><%=quest.elementAt(i) %></td>
				   	<td><center><%=dResponse.elementAt(i) %></center></td>
				   	<td><center><%=dComments.elementAt(i) %></center></td>
				   	<td><center><%=rResponse.elementAt(i) %></center></td>
				   	<td><center><%=rComments.elementAt(i) %></center></td>
				   	</tr>
				<%
				i++;
				}
				
			}
			%>
	</table>
	    <br/>
	<table  border="1" >
	<%

	 if(((String)session.getAttribute("reviewer")).equals("reviewer") && iRevStatus.equals("internal"))
	 {
	 %>
	 <tr>
	 <td><input type="submit" value="Save Comments" ></td>
	 </tr>
	 <tr>
	 <td>Click here to approve Internal IDCE</td><td><input type="submit" value="Submit for External Review" disabled="disabled" onclick="return submitInternalIDCE()" id="internalSubmit" name="internalSubmit" ></td>
	 </tr>
	 <tr>
	  <td><input type="submit" value="Reject" onclick="return rejectInternalIDCE()" ></td><td><textarea id="internalReject" name="internalReject" >Enter reason of rejection</textarea></td>
	  </tr>
	 <%
	 }
	 else if(((String)session.getAttribute("reviewer")).equals("designer")&& iRevStatus.equals("internal") )
	 {
		 %>
		 <tr>
		 <td><input type="submit" value="Save Comments" ></td>
		 </tr>
		 <%
	 }
	 %>
	 </table>
	 <input type="hidden" id="internalIDCE" name="internalIDCE" value="internal" >
	 </form>
	 <%
		  }catch(Exception e)
		  {
			  System.out.println("Displaying Internal IDCE :"+e.getMessage());
		  }
		  
		  if(reject!=null)
		  {
	 %>	 
<table  border="1">
   <tr>
   <td><b>Rejected Times</b></td><td><%=reject.elementAt(0) %></td>
   </tr>
   <tr>
   <td colspan="2"><b>Reason for Rejection</b></td>
   </tr>
   <tr>
   <td colspan="2"><%=reject.elementAt(1) %></td>
   </tr>
   </table>
   
 
   <%
		  }
		  %>
		  <br/>
		  <table border="1">
		     <%
	 if(!((String)session.getAttribute("reviewer")).equals("reviewer") && iRevStatus.equals("internal") )
	 {
		 %>
		 	<tr>
			<td><b>Reviewer approval is pending</b></td>
			</tr>
		 <%
	 }
	 else
	 {
	%>
		 	<tr>
			<td><b>Reviewer has approved the Internal IDCE</b></td>
			</tr>
	<%
	 }
   %>
   </table>
		  
		  
	<%
	  }
   %>
     </div>
     
     <!-- display External IDCE -->
     
     
      <div class="tabbertab">
	  <h2>External IDCE</h2>
	  <p></p>
     
     <%
     {
    	 Vector<String> reject=new Vector<String>();
    	 try
    	 {
    		 String iRevStatus="";
     if(!stsRev.equals("internal"))
     {
    %>
		
	<form >
	  <br/>
	  <%

		  String status="";
		  CRDB crdb=new CRDB(crno);
		  CRDetails crd=new CRDetails(crno);
		  crd.loadDetails();
		  IDCE idce=new IDCE(crno);
		  String link=idce.getIDCELink("external");
		  String number=idce.getIDCENumber("external");
		  String extReviewer=crd.getExternalReviewer();
		  Vector<String> idceCount=idce.getCommentsCount("external");
		  status=crdb.getReviewStatus();
		  
		  reject=cklist.getRejectStatus("external");
		  if(reject==null)
		  {
			  throw new Exception("External reject is null");
		  }
		  
	  if(((String)session.getAttribute("reviewer")).equals("designer") && status.equals("external"))
	  {
	  %>
	<center><h4><a href="addIDCEComments.jsp" >Change the External IDCE details</a></h4></center>
	<br/>
	  <%
	  }
	  %>
	  	 <table border=1 bordercolor="black" >
	  	<tr>
	  	<th colspan="2">IDCE details</th>
	  	</tr>
	  	<tr>
		<td>IDCE Number</td>
		<td><%=number %></td>
	  	</tr>
	  	<tr>
		<td>IDCE Link</td>
		<td><a href="<%=link %>"><%=link %></a></td>
	  	</tr>
	  	<tr>
	  	<td>External Reviewer Name</td>
		<td><%=extReviewer %></td>
	  	</tr>
	  	</table>
	  	<br/>
	  	<table border=1 bordercolor="black" >
	  	<tr>
		<th>Defect Type</th>
		<th> Number of defects</th>
	  	</tr>
		<tr>
		<tr>
		<td>Program Code-High</td>
		<th><%=idceCount.elementAt(0) %></th>
		</tr>
		
		<tr>
		<td>Program Code-Medium</td>
		<th><%=idceCount.elementAt(1) %></th>
		</tr>
		
		<tr>
		<td>Program Code-Low</td>
		<th><%=idceCount.elementAt(2) %></th>
		</tr>
		
		<tr>
		<td>Code Comments</td>
		<th><%=idceCount.elementAt(3) %></th>
		</tr>
		
		<tr>
		<td>Documentation</td>
		<th><%=idceCount.elementAt(4) %></th>
		</tr>
			
		<tr>
		<td>Non Defects</td>
		<th><%=idceCount.elementAt(5) %></th>
		</tr>
			
	 <tr bordercolor="white" ><td>
	 </td></tr>
	 </table>
	 </form>
	 <br/>
	 <form method="post" action="updateIDCEComments.jsp" id="externalForm" name="externalForm">
	 <table border=1 bordercolor="black">
	 <tr>
	 <th>Pre-Approval of External IDCE Questions</th>
	 <th>Designer Response</th>
	 <th>Designer Comments</th>
	 <th>Reviewer Response</th>
	 <th>Reviewer Comments</th>
	 </tr>
		<%
		 {
	         CRDB crDB=new CRDB(crno);
	     	 crDB.loadDetails();
	     	iRevStatus=crDB.getReviewStatus();
		 }
			Vector<String> rResponse,dResponse;
			Vector<String> rComments,dComments;
			Vector<String> quest;
			idce.loadIDCEResponse("external");
			rResponse=idce.getReviewerResponse();
			rComments=idce.getReviewerComments();
			dResponse=idce.getDesignerResponse();
			dComments=idce.getDesignerComments();

			quest=idce.getQuest();

			if(((String)session.getAttribute("reviewer")).equals("reviewer") && iRevStatus.equals("external"))
			{
				int i=0;
				String selected;

				while(i <quest.size())
				{
					selected=rResponse.elementAt(i);
					%>
					<tr>
					<td><%=quest.elementAt(i) %></td>
					<td><center><%=dResponse.elementAt(i) %></center></td>
					<td><center><%=dComments.elementAt(i) %></center></td>
					<%
		  	 		if(selected.equals("Yes"))
		   			{
			   		%>
			   		<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="validateInternalQuest()" ><option selected="selected" value="Yes">Yes</option><option value="No">No</option><option value="NA">NA</option></select></td>
			   		<%
		   			}else if(selected.equals("No"))
		   			{
			   		%>
			   		<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="validateInternalQuest()" ><option selected="selected" value="No">No</option><option value="Yes">Yes</option><option value="NA" >NA</option></select></td>
			   		<%
		   			}
		   			else
		   			{
			   		%>
			  		 <td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="validateInternalQuest()" ><option selected="selected" value="NA">NA</option><option value="Yes">Yes</option><option value="No">No</option></select></td>
			   		<%
		   			}
		   			%>
			
					<td><textarea id="text<%=i %>" name="text<%=i%>" ><%=rComments.elementAt(i) %></textarea></td>
					</tr>
	
					<%
					i++;
				}
			}
			else if(((String)session.getAttribute("reviewer")).equals("designer") && iRevStatus.equals("external"))
			{
				int i=0;
				String selected;

				while(i <quest.size())
				{
					selected=dResponse.elementAt(i);
					%>
					<tr>
					<td><%=quest.elementAt(i) %></td>
					<%
			 
		  	 		if(selected.equals("Yes"))
		   			{
			   		%>
			   		<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="validateInternalQuest()" ><option selected="selected" value="Yes">Yes</option><option value="No">No</option><option value="NA">NA</option></select></td>
			   		<%
		   			}else if(selected.equals("No"))
		   			{
			   		%>
			   		<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="validateInternalQuest()" ><option selected="selected" value="No">No</option><option value="Yes">Yes</option><option value="NA" >NA</option></select></td>
			   		<%
		   			}
		   			else
		   			{
			   		%>
			  		 <td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="validateInternalQuest()" ><option selected="selected" value="NA">NA</option><option value="Yes">Yes</option><option value="No">No</option></select></td>
			   		<%
		   			}
		   			%>
			
					<td><textarea id="text<%=i %>" name="text<%=i%>" ><%=dComments.elementAt(i) %></textarea></td>
					<td><center><%=rResponse.elementAt(i) %></center></td>
					<td><center><%=rComments.elementAt(i) %></center></td>
					</tr>
	
					<%
					i++;
				}
			}
			else
			{
				int i=0;
				while(i< quest.size())
				{
				%>
					<tr>
				   	<td><%=quest.elementAt(i) %></td>
				   	<td><center><%=dResponse.elementAt(i) %></center></td>
				   	<td><center><%=dComments.elementAt(i) %></center></td>
				   	<td><center><%=rResponse.elementAt(i) %></center></td>
				   	<td><center><%=rComments.elementAt(i) %></center></td>
				   	</tr>
				<%
				i++;
				}
				
			}
			%>
	</table>
		    <br/>
		<table  border="1">
	<%
	if(((String)session.getAttribute("reviewer")).equals("reviewer") && iRevStatus.equals("external"))
	 {
	 %>
	 <tr>
	 <td><input type="submit" value="Save Comments" ></td>
	 </tr>
	 <tr>
	 <td>Click on Approve to approve external IDCE and open PreSubmission</td><td><input type="submit" value="Approve" disabled="disabled" onclick="return submitExternalIDCE()" id="externalSubmit" name="externalSubmit" ></td>
	 </tr>
	 <tr>
	 <td><input type="submit" value="Reject" onclick="return rejectExternalIDCE()" ></td><td><textarea id="externalReject" name="externalReject">Enter reason to reject</textarea></td>
	 </tr>
	 <%
	 }
	 else if(((String)session.getAttribute("reviewer")).equals("designer")&& iRevStatus.equals("external") )
	 {
		 %>
		 <tr>
		 <td><input type="submit" value="Save Comments" ></td>
		 </tr>
		 <%
	 }
	 %>
	 </table>
	 <input type="hidden" id="externalIDCE" name="externalIDCE" value="external" >
	 </form>
	 
	<table  border="1">
   <tr>
   <td><b>Rejected Times</b></td><td><%=reject.elementAt(0) %></td>
   </tr>
   <tr>
   <td colspan="2"><b>Reason for Rejection</b></td>
   </tr>
   <tr>
   <td colspan="2"><%=reject.elementAt(1) %></td>
   </tr>
   </table>
   <br/>
   <table border="1">
   <%
   if(!((String)session.getAttribute("reviewer")).equals("reviewer") && iRevStatus.equals("external") )
	 {
		 %>
		 	<tr>
			<td><b>Reviewer approval is pending</b></td>
			</tr>
		 <%
	 }
	else
	{
		 %>
		 <tr>
		 <td><b>Reviewer has approved the External IDCE</b></td>
		 </tr>
		 <%
	}
   %>
   </table>
     <%
     }
     else
     {
    	 %>
    	 <h4>External IDCE is not opened. Please Approve the Internal IDCE to open external IDCE</h4>
    	 <%
     }
    	 }catch(Exception e)
    	 {
    		 System.out.println("Exception while displaying external :"+crno+" :"+e.getMessage());
    	 }
     }
     %>
     </div>
     
     
     <!-- Display test plan -->
     <div class="tabbertab">
	 <h2> Test Cases </h2>
	 <p></p>
	 <form method="post" action="updateTestCases.jsp">
 	<table border=1 bordercolor="black" width="100%">
 		 	<tr>
	 	<td width="7%"><b>SR no.</b></td>
	 	<td width="80%"><b>TC Title</b></td>
	 	<td width="13%"><b>TC Scenario Type</b></td>
	 	<td width="7%"><b>TC Result</b></td>
	 	</tr>
	 <%
	 {
	 try{
	 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     Connection con4 = DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Excel Driver (*.xls)};DBQ=C:\\database\\"+crno+";"+ "DriverID=22;READONLY=false","","");
     Statement stmt4 = con4.createStatement();
     String query="select * from [TestPlan$]";
     ResultSet rs4=stmt4.executeQuery(query);
     String srno="",title="",scenario="",result="";
     int tCount=0;
     while(rs4.next())
     {
    	 srno=rs4.getString("srno");
    	 title=rs4.getString("testCases");
    	 title.replaceAll("<","&#060;");
    	 title.replaceAll(">","&#062;");
    	 scenario=rs4.getString("scenario");
    	 result=rs4.getString("result");
    	 
    	 if(session.getAttribute("reviewer").toString().equals("designer"))
    	 {
    	 		%>
    			<tr>
    			<td><center><p><%=srno %></p></center></td>
    			<td><textarea cols="70" id="title<%=tCount %>" name="title<%=tCount %>" ><%=title %></textarea></td>
    			<td><center><input id="scenario<%=tCount %>" name="scenario<%=tCount %>" type="text" value="<%=scenario %>"></center></td>
    			<td><center><input id="result<%=tCount %>" name="result<%=tCount %>" type="text" value="<%=result %>" ></center></td>
    			</tr>
    			<%
				tCount++;
    	 }
    	 else
    	 {
    	 		%>
    			<tr>
    			<td><center><p><%=srno %></p></center></td>
    			<td><%=title %></td>
    			<td><center><%=scenario %></center></td>
    			<td><center><%=result %></center></td>
    			</tr>
    			<%
    	 }
     }
	 rs4.close();
	 stmt4.close();
	 con4.close();
	 }catch(Exception e)
	 {
		System.out.println("displaying test cases:"+crno+" :"+e.getMessage());
	 }
	 %>
	 </table>
	 <%if(session.getAttribute("reviewer").toString().equals("designer"))
	 {	 
	 %>
	 <input type="submit" value="Save Changes">
	 <%
	 }
	 %>
	 </form>
	 <br/>
	 	  <%
	  if(session.getAttribute("reviewer").toString().equals("designer"))
	  {
		  TestCase tc=new TestCase(crno);
		  %>
			<form action="saveTestCases.jsp" method="post">
			
			<table width="100%">
			 <tr>
			 <td width="20%">TC Logs Location:</td><td><input type="text" id="logs" name="logs" value="<%=tc.getTCLink("logs") %>"></td>
			 </tr>
			 <tr >
			 <td width="20%">TC Description: </td><td><input type="text" id="descPath" name="descPath" value="<%=tc.getTCLink("description") %>"></td>
			 </tr>
			 </table>
	 		<br/>
		  	<h3>Click button below to add more test cases</h3>
			<div id="my_div"></div>
			<input type=hidden value="0" id="hidden1" name="hidden1" >
			<input type="button" value="Add more Test Cases" onClick="changeIt()">
			<input type="submit" value="Save" onclick="return validateTextCases()" >
			</form>
		  <%
	  }
	}
	 	  %>
     </div>



     <!-- Pre-Submission -->


	 <div class="tabbertab">
	 <h2>Pre-Submission </h2>
	 <p></p>

	 <%
	 {
		 Vector<String> reject=null;
		 try
		 {
	
	 if(!(stsRev.equals("internal") || stsRev.equals("external") ))
	 {
		 
		 %>
	 <form method="post" action="savePreSubmission.jsp" id="preform" name="preform" >
		 <%
		 
		 PreSubmission pre=new PreSubmission(crno);
		 
		 pre.loadDetails();
		 int commonLength=4,nativeLength=10,sosLength=15;
		 CRDB crdb=new CRDB(crno);
		 crdb.loadDetails();
		 Inbox inb=new Inbox(crno);
		 inb.loadDetails();

		 Vector<String> query=pre.getQueries();
		 Vector<String> designer=pre.getDesignerComments();
		 Vector<String> dResponse=pre.getDesigerResponse();
		 Vector<String> reviewer=pre.getReviewerComments();
		 Vector<String> rResponse=pre.getReviewerResponse();
		 String subType=crdb.getSubmissionType();
		 String nativeQuest="",sosQuest="";
		
		 String subStatus=crdb.getSubmissionStatus("presubmission");
		 String manStatus=inb.getManagerStatus();

		  reject=cklist.getRejectStatus("presubmission");
		  if(reject==null)
		  {
			  throw new Exception("Presubmission reject is null");
		  }

		 if(subType.equals("native"))
		 {
			 nativeQuest="Yes";
		 }
		 else
		 {
			 nativeQuest="NA";
		 }
		 
		 if(subType.equals("sos"))
		 {
			 sosQuest="Yes";
		 }
		 else
		 {
			 sosQuest="NA";
		 }
		 
		 int i=0;
		 String temp;

		 if(session.getAttribute("reviewer").toString().equals("reviewer"))
		 {
			// code to edit reviewer comments
		 %>
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr><td colspan="5"><b>Common Questions</b></td></tr>
		 <tr>
		 <td></td>
		 <td colspan="2"><center>Designer Comments</center></td>
		 <td colspan="2">Reviewer Comments</td>
		 </tr>
		 <%
			while(i< commonLength && i < query.size())
			{
				%>
				<tr>
				<td><%=query.elementAt(i) %></td>
				<td><%=dResponse.elementAt(i) %></td>
				<td><%=designer.elementAt(i) %></td>
				<%
				temp=rResponse.elementAt(i);
				if(temp.equals("Yes"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected">Yes</option><option>No</option><option>NA</option></select></td>
					<%
				}else if(temp.equals("No"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected">No</option><option>Yes</option><option>NA</option></select></td>
					<%
				}
				else
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected">NA</option><option>Yes</option><option>No</option></select></td>
					<%
				}
				%>
				<td><textarea id="text<%=i %>" name="text<%=i %>"><%=reviewer.elementAt(i) %></textarea></td>
				</tr>
				<%
				i++;
			}
		 i=commonLength;
		 %>
		 </table>
		 <br/>
		 
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr><td colspan="4"><b>Does your fix churn Native Code</b></td><td><%=nativeQuest %></td></tr>
		 </table>
		 <%
		 if(nativeQuest.equals("Yes"))
		 {
		 %>
		 <div id="nativeDiv">
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr>
		 <td></td>
		 <td colspan="2"><center>Designer Comments</center></td>
		 <td colspan="2"><center>Reviewer Comments</center></td>
		 </tr>
		 <%
			while(i< nativeLength && i < query.size())
			{
				%>
				<tr>
				<td><%=query.elementAt(i) %></td>
				<td><%=dResponse.elementAt(i) %></td>
				<td><%=designer.elementAt(i) %></td>
				<%
				if(subType.equals("native")||subType.equals("both"))
				{
				temp=rResponse.elementAt(i);
				if(temp.equals("Yes"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected">Yes</option><option>No</option><option>NA</option></select></td>
					<%
				}else if(temp.equals("No"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected">No</option><option>Yes</option><option>NA</option></select></td>
					<%
				}
				else
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected">NA</option><option>Yes</option><option>No</option></select></td>
					<%
				}
				%>
				<td><textarea id="text<%=i %>" name="text<%=i %>"><%=reviewer.elementAt(i) %></textarea></td>
				<%
				}else
				{
					%>
					
					<td><%=rResponse.elementAt(i) %></td>
					<td><textarea id="text<%=i %>" name="text<%=i %>"><%=reviewer.elementAt(i) %></textarea></td>
					<%
				}
				%>
				</tr>
				<%
				i++;
			} 
		 %>
		 </table>
		 </div>
		 <%
		 }
		 i=nativeLength;
		 %>
		 <br/>
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		  <tr><td colspan="4"><b>Does your fix churn SOS Code</b></td><td><%=sosQuest %></td></tr>
		  </table>
		  <%
			 if(sosQuest.equals("Yes"))
			 {
		  %>
		  <div id="sosDiv">
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr>
		 <td></td>
		 <td colspan="2"><center>Designer Comments</center></td>
		 <td colspan="2"><center>Reviewer Comments</center></td>
		 </tr>
		 <%
			while(i< sosLength && i < query.size())
			{
				%>
				<tr>
				<td><%=query.elementAt(i) %></td>
				<td><%=dResponse.elementAt(i) %></td>
				<td><%=designer.elementAt(i) %></td>
				<%
				if(subType.equals("sos")||subType.equals("both"))
				{
					
				temp=rResponse.elementAt(i);
				if(temp.equals("Yes"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected" value="Yes">Yes</option><option value="No">No</option><option value="NA">NA</option></select></td>
					<%
				}else if(temp.equals("No"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected" value="No">No</option><option value="Yes">Yes</option><option value="NA">NA</option></select></td>
					<%
				}
				else
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected" value="NA">NA</option><option value="Yes">Yes</option><option value="No">No</option></select></td>
					<%
				}
				%>
				<td><textarea id="text<%=i %>" name="text<%=i %>"><%=reviewer.elementAt(i) %></textarea></td>
				<%
				}else
				{
					%>
					<td><%=rResponse.elementAt(i) %></td>
					<td><textarea id="text<%=i %>" name="text<%=i %>"><%=reviewer.elementAt(i) %></textarea></td>
					<%
				}
				%>
				</tr>
				<%
				i++;
			} 
		 %>
		 </table>
		 </div>
		 <%
		 }
		 }
		 else if(session.getAttribute("reviewer").toString().equals("designer"))
		 {
			// code to edit the designer comments
		 %>
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr><td colspan="5"><b>Common Questions</b></td></tr>
		 <tr>
		 <td></td>
		 <td colspan="2"><center>Designer Comments</center></td>
		 <td colspan="2"><center>Reviewer Comments</center></td>
		 </tr>
		
		 <%
			while(i<commonLength && i < query.size())
			{
				%>
				<tr>
				<td><%=query.elementAt(i) %></td>
				<%
				temp=dResponse.elementAt(i);
				if(temp.equals("Yes"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected" value="Yes">Yes</option><option value="No">No</option><option value="NA">NA</option></select></td>
					<%
				}else if(temp.equals("No"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected" value="No">No</option><option value="Yes">Yes</option><option value="NA">NA</option></select></td>
					<%
				}
				else
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected" value="NA">NA</option><option value="Yes">Yes</option><option value="No">No</option></select></td>
					<%
				}
				%>
				<td><textarea id="text<%=i %>" name="text<%=i %>"><%=designer.elementAt(i) %></textarea></td>
				<td><%=rResponse.elementAt(i) %></td>
				<td><%=reviewer.elementAt(i) %></td>
				</tr>
				<%
				i++;
			}
		 %>
		 </table>
		 <br/>
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr><td colspan="4"><b>Does your fix churn Native Code</b></td>
		 <% 

		 if(subType.equals("notDefined")|| subType.equals("sos"))
		 {
		 %>
		 <td><select id="preNativeQuest" name="preNativeQuest" onchange="validatePreNative()"><option value="No">No</option><option value="Yes">Yes</option></select></td>
		 <% 
		 }
		 else if(subType.equals("native")||subType.equals("both"))
		 {
		 %>
		 <td><select id="preNativeQuest" name="preNativeQuest" onchange="validatePreNative()"><option value="Yes">Yes</option><option value="No">No</option></select></td>
		 <%
		 }
		 %>
		 </tr>
		 </table>
		 <div id="nativeDiv">
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr>
		 <td></td>
		 <td colspan="2"><center>Designer Comments</center></td>
		 <td colspan="2"><center>Reviewer Comments</center></td>
		 </tr>
		 <%
		 
		 // code for the presubmission Native
			while(i<nativeLength && i < query.size())
			{
				%>
				<tr>
				<td><%=query.elementAt(i) %></td>
				<%
				temp=dResponse.elementAt(i);
				if(temp.equals("Yes"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected" value="Yes">Yes</option><option value="No">No</option><option value="NA">NA</option></select></td>
					<%
				}else if(temp.equals("No"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected" value="No">No</option><option value="Yes">Yes</option><option value="NA">NA</option></select></td>
					<%
				}
				else
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected" value="NA">NA</option><option value="Yes">Yes</option><option value="No">No</option></select></td>
					<%
				}
				%>
				<td><textarea id="text<%=i %>" name="text<%=i %>"><%=designer.elementAt(i) %></textarea></td>
				<td><%=rResponse.elementAt(i) %></td>
				<td><%=reviewer.elementAt(i) %></td>
				</tr>
				<%
				i++;
			}
		 %>
		 </table>
		 </div>
		<br/>
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr><td colspan="4"><b>Does your fix churn SOS Code</b></td>
		 <% 
		 if(subType.equals("notDefined")||subType.equals("native") )
		 {
		 %>
		 <td><select id="preSosQuest" name="preSosQuest"  onchange="validatePreSos()" ><option value="No">No</option><option value="Yes">Yes</option></select></td>
		 <% 
		 }
		 else if(subType.equals("sos")||subType.equals("both"))
		 {
		 %>
		 <td><select id="preSosQuest" name="preSosQuest" onchange="validatePreSos()"  ><option value="Yes">Yes</option><option value="No">No</option></select></td>
		 <%
		 }
		 %>
		 </tr>
		 </table>
		 <div id="sosDiv" >
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr>
		 <td></td>
		 <td colspan="2"><center>Designer Comments</center></td>
		 <td colspan="2"><center>Reviewer Comments</center></td>
		 </tr>
		 <%
			while(i< sosLength && i < query.size())
			{
				%>
				<tr>
				<td><%=query.elementAt(i) %></td>
				<%
				temp=dResponse.elementAt(i);
				if(temp.equals("Yes"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected" value="Yes">Yes</option><option value="No">No</option><option value="NA">NA</option></select></td>
					<%
				}else if(temp.equals("No"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected" value="No">No</option><option  value="Yes">Yes</option><option value="NA">NA</option></select></td>
					<%
				}
				else
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" ><option selected="selected" value="NA">NA</option><option  value="Yes">Yes</option><option value="No">No</option></select></td>
					<%
				}
				%>
				<td><textarea id="text<%=i %>" name="text<%=i %>"><%=designer.elementAt(i) %></textarea></td>
				<td><%=rResponse.elementAt(i) %></td>
				<td><%=reviewer.elementAt(i) %></td>
				</tr>
				<%
				i++;
			}
		 %>
		 </table>
		 </div>
		 <%
		 
		 }else
		 {
				 // code to show read only boxes
		 %>
		 
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr><td colspan="5"><b>Common Questions</b></td></tr>
		 <tr>
		 <td></td>
		 <td colspan="2"><center>Designer Comments</center></td>
		 <td colspan="2"><center>Reviewer Comments</center></td>
		 </tr>
		 <%
			while(i < commonLength && i < query.size())
			{
				%>
				<tr>
				<td><%=query.elementAt(i) %></td>
				<td><%=dResponse.elementAt(i) %></td>
				<td><%=designer.elementAt(i) %></td>
				<td><%=rResponse.elementAt(i) %></td>
				<td><%=reviewer.elementAt(i) %></td>
				</tr>
				<%
				i++;
			}
		 i=commonLength;
			 %>
			 </table>
			<br/>
			
			<%
			if(nativeQuest.equals("Yes"))
			{
			%>
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr><td colspan="4"><b>Does your fix churn Native Code</b></td><td><%=nativeQuest %></td></tr>
			 <tr>
		 	<td></td>
			<td colspan="2"><center>Designer Comments</center></td>
		 	<td colspan="2"><center><center>Reviewer Comments</center></center></td>
		 	</tr>
		 <%
			while(i < nativeLength && i < query.size())
			{
				%>
				<tr>
				<td><%=query.elementAt(i) %></td>
				<td><%=dResponse.elementAt(i) %></td>
				<td><%=designer.elementAt(i) %></td>
				<td><%=rResponse.elementAt(i) %></td>
				<td><%=reviewer.elementAt(i) %></td>
				</tr>
				<%
				i++;
			} 
			 %>
			 </table>
			 <br/>
			 
			 <%
		 	}
			else
			{
				 %>
				 <br/>
				 <h4>No Native questions are selected</h4>
				 <%
			}
			
			i=nativeLength;
			 if(sosQuest.equals("Yes"))
			 {
			 %>
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
			  <tr><td colspan="4"><b>Does your fix churn SOS Code</b></td><td><%=sosQuest %></td></tr>
			<tr>
		 	<td></td>
		 	<td colspan="2"><center>Designer Comments</center></td>
		 	<td colspan="2"><center><center>Reviewer Comments</center></center></td>
		 	</tr>
		 <%
			while(i < sosLength && i < query.size() )
			{
				%>
				<tr>
				<td><%=query.elementAt(i) %></td>
				<td><%=dResponse.elementAt(i) %></td>
				<td><%=designer.elementAt(i) %></td>
				<td><%=rResponse.elementAt(i) %></td>
				<td><%=reviewer.elementAt(i) %></td>
				</tr>
				<%
				i++;
			} 
			 %>
			 </table>
			 <%
			 }
			 else
			 {
				 %>
				 <br/>
				 <h4>No SOS questions are selected</h4>
				 <%
			 }
		 } 
		 	%>
		 	    <br/>
		 	<table  border="1">
			 <%
		 if(session.getAttribute("reviewer").toString().equals("designer") && !stsRev.equals("submitted"))
		 {
			 if(subStatus.equals("open"))
			 {
			 %>
			 <tr>
			 <td>Reviewer approval is pending :</td> <td><input type="submit" value="save"></td>
			 </tr>
			 <%
			 }
		 }
		 else if(session.getAttribute("reviewer").toString().equals("reviewer") && !stsRev.equals("submitted"))
		 {

			 if(subStatus.equals("open"))
			 {
			 %>
			 <tr>
			 <td>Click on Approve to code submission approval </td> <td><input type="submit" value="Approve" ></td><td><input type="submit" value="Reject" onclick="return submitPresubmission('preReviewerRejectReason')" ></td><td><textarea id="preReviewerRejectReason" name="preReviewerRejectReason">Enter Reason to reject</textarea></td>
			 </tr>		
			 <%
			 }
		 }
		 else if(session.getAttribute("reviewer").toString().equals("manager") && !stsRev.equals("submitted"))
		 {
			 
			 if(subStatus.equals("open"))
			 {
			 %>
			 <tr>
			 <td><b>Reviewers approval is pending</b></td>
			 </tr>		
			 <%
			 }
			 if(manStatus.equals("open"))
			 {
			 %>
			 <tr>
			  <td>Click on approve to Allow Code submission </td> <td><input type="submit" value="Approve" ></td><td><input type="submit" value="Reject" onclick="return submitPresubmission('preManagerRejectReason')" ></td><td><textarea id="preManagerRejectReason" name="preManagerRejectReason">Enter Reason to reject</textarea></td>
			  </tr>
			 <%
			 }
		 }
		 %>
		  </table>
	 <input type="hidden" id="presubmission" name="presubmission" value="true">
	 </form>
	<table  border="1">
	<tr>
	<td colspan="2"><b>Reviewer</b></td><td></td><td colspan="2"><b>Manager</b></td>
	</tr>
   <tr>
   <td><b>Rejected Times : <%=reject.elementAt(0) %></b></td><td></td>
   <td></td>
   <td><b>Rejected Times : <%=reject.elementAt(2) %></b></td><td></td>
   </tr>
   <tr>
   <td colspan="2"><b>Reason for Rejection</b></td>
   <td></td>
   <td colspan="2"><b>Reason for Rejection</b></td>
   </tr>
   <tr>
   <td colspan="2"><%=reject.elementAt(1) %></td>
   <td></td>
   <td colspan="2"><%=reject.elementAt(3) %></td>
   </tr>
   </table>
	 	 
	 	 
	<br/>
	<table>
	<%
	 if(session.getAttribute("reviewer").toString().equals("designer") && !stsRev.equals("submitted"))
	 {
		 if(!subStatus.equals("open"))
		 {
			 %>
			 <tr>
			 <td><b>Reviewer Has approved the Pre-Submission </b></td>
			 </tr>
			 <%
		 }
		 if(manStatus.equals("open"))
		 {
			 %>
			 <tr>
			 <td><b>Manager approval is pending </b></td>
			 </tr>
			 <%
		 }
		 else
		 {
			 %>
			 <tr>
			 <td><b>Manager has approved the PreSubmission. You can move forward with code submission </b></td>
			 </tr>
			 <%
		 }
	 }
	 else if(session.getAttribute("reviewer").toString().equals("reviewer") && !stsRev.equals("submitted"))
	 {

		 if(!subStatus.equals("open"))
		 {
			 %>
			 <tr>
			 <td><b>Reviewer has Approved the Pre-Submission</b></td>
			 </tr>		
			 <%
		 }
		 if(manStatus.equals("open"))
		 {
			 %>
			 <tr>
			 <td><b>Manager Approval is pending</b></td>
			 </tr>		
			 <%
		 }
		 else
		 {
			 %>
			 <tr>
			 <td><b>PreSubmission has been approved by manager</b></td>
			 </tr>		
			 <%
		 }
	 }
	 else if(session.getAttribute("reviewer").toString().equals("manager") && !stsRev.equals("submitted"))
	 {
		 
		 if(subStatus.equals("open"))
		 {
		 %>
		 <tr>
		 <td><b>Reviewers approval is pending</b></td>
		 </tr>		
		 <%
		 }
		 else
		 {
			 %>
			 <tr>
			 <td><b>Reviewer has Approved the Pre-Submission</b></td>
			 </tr>		
			 <%
		 }
		 
		 if(!manStatus.equals("open"))
		 {
			 %>
			 <tr>
			  <td><b>PreSubmission has been approved</b></td>
			  </tr>
			 <%
		 }
	 }
	 else
	 {
		 if(subStatus.equals("open"))
		 {
		 %>
		 <tr>
		 <td><b>Reviewer Approval is pending</b></td>
		 </tr>
		 <%
		 }
		 else
		 {
			 %>
			 <tr>
			 <td><b>Reviewer Has approved the </b></td>
			 </tr>
			 <%
		 }
		 if(manStatus.equals("open"))
		 {
			 %>
			 <tr>
			 <td><b>Manager approval is pending </b></td>
			 </tr>
			 <%
		 }
		 else
		 {
			 %>
			 <tr>
			 <td><b>Manager has approved the PreSubmission. You can move forward with code submission</b> </td>
			 </tr>
			 <%
		 }
	 }
	 %>
	  </table>

		 <%
	 }else
     {
    	 %>
    	 <h4>Pre-Submission is not opened. Pre-Submission follows the External IDCE. Please Approve the External IDCE to open Pre-Submission</h4>
    	 <%
     }
		 }catch(Exception e)
		 {
			 System.out.println("Exception in presubmission"+crno+" :"+e.getMessage());
		 }
	 }
	 %>
	 </div>


	<!-- Post Submission -->
	  <div class="tabbertab">
	 <h2>Post Submission </h2>
	 <p></p>
	 <%
	 {
		 Vector<String> reject=null;
		 
		 try
		 {
	 if(!(stsRev.equals("internal") || stsRev.equals("external") || stsRev.equals("presubmission")))
	 {
		 
	 %>
	 <form method="post" action="savePostSubmission.jsp" name="postform" id="postform" >
		 <%
		 
		 PostSubmission post=new PostSubmission(crno);
		 post.loadDetails();

		 Vector<String> query=post.getQueries();
		 Vector<String> designer=post.getDesignerComments();
		 Vector<String> dResponse=post.getDesigerResponse();
		 Vector<String> reviewer=post.getReviewerComments();
		 Vector<String> rResponse=post.getReviewerResponse();

		  reject=cklist.getRejectStatus("postsubmission");
		  if(reject==null)
		  {
			  throw new Exception("Postsubmission reject is null");
		  }
		 
		 int i=0;
		 String temp;

		 if(session.getAttribute("reviewer").toString().equals("reviewer"))
		 {
			// code to edit Reviewer
		 %>
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr>
		 <th>Answer following question</th>
		 <th colspan=2><center>Designer Comments</center></th>
		 <th colspan=2><center>Reviewer Comments</center></th>
		 </tr>
		 <%
			while(i< query.size())
			{
				%>
				<tr>
				<td><%=query.elementAt(i) %></td>
				<td><%=dResponse.elementAt(i) %></td>
				<td><%=designer.elementAt(i) %></td>
				<%
				temp=rResponse.elementAt(i);
				if(temp.equals("Yes"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="postValidate()"><option selected="selected" value="Yes">Yes</option><option value="No">No</option><option value="NA">NA</option></select></td>
					<%
				}else if(temp.equals("No"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="postValidate()"><option selected="selected" value="No">No</option><option value="Yes">Yes</option><option value="NA">NA</option></select></td>
					<%
				}
				else
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>" onchange="postValidate()"><option selected="selected" value="NA">NA</option><option value="Yes">Yes</option><option value="No">No</option></select></td>
					<%
				}
				%>
				<td><textarea id="text<%=i %>" name="text<%=i %>"><%=reviewer.elementAt(i) %></textarea></td>
				</tr>
				<%
				i++;
			} 
		 %>
		 </table>
		
		 <%
		 
		 }
		 else if(session.getAttribute("reviewer").toString().equals("designer"))
		 {
			// code to edit the designer comments
		 %>
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr>
		 <th>Answer the following questions</th>
		 <th colspan=2><center>Designer Ccmments</center></th>
		 <th colspan=2><center>Reviewer Comments</center></th>
		 </tr>
		 <%
			while(i<query.size())
			{
				%>
				<tr>
				<td><%=query.elementAt(i) %></td>
				<%
				temp=dResponse.elementAt(i);
				if(temp.equals("Yes"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>"  ><option selected="selected" value="Yes"  >Yes</option><option value="No">No</option><option value="NA">NA</option></select></td>
					<%
				}else if(temp.equals("No"))
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i%>"  ><option selected="selected" value="No"  >No</option><option value="Yes">Yes</option><option value="NA">NA</option></select></td>
					<%
				}
				else
				{
					%>
					<td bgcolor='AliceBlue'><select id="dd<%=i%>" name="dd<%=i %>" ><option selected="selected" value="NA" >NA</option><option value="Yes">Yes</option><option value="No">No</option></select></td>
					<%
				}
				%>
				<td><textarea id="text<%=i %>" name="text<%=i %>"><%=designer.elementAt(i) %></textarea></td>
				<td><%=rResponse.elementAt(i) %></td>
				<td><%=reviewer.elementAt(i) %></td>
				</tr>
				<%
				i++;
			}
		 %>
		 </table>
		 
		 <%
		 
		 }else
		 {
				 // code to show read only boxes
		 %>
		 <table border=1 bordercolor="black" width="100%">
		 <tr>
		 <td width="46%" ></td><td width="7%"></td><td width="20%"></td><td width="7%"></td><td width="20%"></td>
		 </tr>
		 <tr>
		 <th>Questions for post submission</th>
		 <th colspan=2><center>Designer Ccmments</center></th>
		 <th colspan=2><center>Reviewer Comments</center></th>
		 </tr>
		 <%
			while(i < query.size())
			{
				%>
				<tr>
				<td><%=query.elementAt(i) %></td>
				<td><%=dResponse.elementAt(i) %></td>
				<td><%=designer.elementAt(i) %></td>
				<td><%=rResponse.elementAt(i) %></td>
				<td><%=reviewer.elementAt(i) %></td>
				</tr>
				<%
				i++;
			} 
			 %>
			 </table>
			 
			 <%
		 }
		 %>
		 <br/>
			<table  border="1">
		 <%
		 
		 if(session.getAttribute("reviewer").toString().equals("designer") && !stsRev.equals("submitted"))
		 {
			 %>
			 <tr><td><center><input type="submit" value="save"></center></td></tr>
			 <%
		 }
		 else if(session.getAttribute("reviewer").toString().equals("reviewer") && !stsRev.equals("submitted"))
		 {
			 %>
			 <tr><td>
			 <center>
			 <input type="submit" value="Approve the submission" id="postApprove" name="postApprove" > <input type="submit" value="Reject" onclick="return submitPostsubmission()" ><textarea id="postRejectReason" name="postRejectReason">Enter Reason to reject</textarea>
			 </center>
			 </td></tr>
			 <%
		 }
		 
		
		 %>
		 </table>
		 <input type="hidden" id="postsubmission" name="postsubmission" value="true" >
	</form>
	
	<table  border="1">
	<tr>
	<td colspan="2"><b>Reviewer</b></td>
	</tr>
   <tr>
   <td><b>Rejected Times</b></td><td><%=reject.elementAt(0) %></td>
   </tr>
   <tr>
   <td colspan="2"><b>Reason for Rejection</b></td>
   </tr>
   <tr>
   <td colspan="2"><%=reject.elementAt(1) %></td>
   </tr>
   </table>
   
   <br/>
	<table border="1" >
	<%
	if(stsRev.equals("submitted"))
	 {
		 %>
		 <tr><td><b>Reviewer has approved the Post-Submission. <br/> The process of Code submission has been completed successfully.</b></td></tr>
		 <%
	 }else
	 {
		 %>
		 <tr><td><b>Reviewer approval is pending</b></td></tr>
		 <%
	 }
	%>
	</table>
	<%
	 }
	 else
     {
    	 %>
    	 <h4>Post-Submission is not opened. Post-Submission follows the Pre-Submission. Please Approve the Pre-Submission to open Post-Submission</h4>
    	 <%
     }
		 }catch(Exception e)
		 {
			 System.out.println(" Exception in post submission display :"+crno+" :"+e.getMessage());
		 }
	 }
	 
	}
	 %>
	 	</div>
</div>
</body>
</html>